package ch08;

public class Quiz implements Measurable {
	private String letterGrade;
	private double score;
	
	public Quiz(double quizScore)
	{
		score = quizScore;
		letterGrade = calculateLetterGrade(score);
	}

	@Override
	public double getMeasure() {
		return score;
	}
	
	private String calculateLetterGrade(double quizScore)
	{
		String letter = "";
		if(quizScore < 100){
			letter = "C";
		} else if (quizScore < 200) {
			letter = "B";
		} else {
			letter = "A";
		}
		return letter;
	}
	
	public String getLetterGrade()
	{
		return letterGrade;
	}
}
